﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Add.aspx.cs" Inherits="socialnexus.admin.Administrators.Add"
MasterPageFile="~/masters/Admin.Master" %>

<asp:Content ContentPlaceHolderID="body" runat="server">

<h1>Add an Administrator User</h1>

<asp:Label ID="lblError" runat="server" CssClass="error" Visible="false" EnableViewState="false" />

<div><asp:HiddenField runat="server" ID="hfUserId" /></div>

<div class="formLineItem">
    <asp:Label ID="Label1" runat="server" Text="Username" 
        AssociatedControlID="txtUserName" />
    <asp:TextBox ID="txtUserName" runat="server" />
    <asp:RequiredFieldValidator ControlToValidate="txtUserName" runat="server"
        ErrorMessage="The UserName is required." Display="Dynamic" />
    <asp:CustomValidator ControlToValidate="txtUserName" runat="server" Display="Dynamic"
        OnServerValidate="ValidateUniqueUsername" ErrorMessage="That account already exists." />
</div>

<div class="formLineItem">
    <asp:Label ID="lblFirstName" runat="server" Text="First Name" 
        AssociatedControlID="txtFirstName" />
    <asp:TextBox ID="txtFirstName" runat="server" />
    <asp:RequiredFieldValidator ControlToValidate="txtFirstName" runat="server"
        ErrorMessage="The First Name is required." Display="Dynamic" />
</div>

<div class="formLineItem">
    <asp:Label ID="lblLastName" runat="server" Text="Last Name"
        AssociatedControlID="txtLastName" />
    <asp:TextBox ID="txtLastName" runat="server" />
    <asp:RequiredFieldValidator ControlToValidate="txtLastName" runat="server"
        ErrorMessage="The Last Name is required." Display="Dynamic" />
</div>

<div class="formLineItem">
    <asp:Label ID="lblPassword" runat="server" Text="Password"
        AssociatedControlID="txtPassword" />
    <asp:TextBox TextMode="Password" ID="txtPassword" runat="server" />
    <asp:RequiredFieldValidator ControlToValidate="txtPassword" runat="server"
        ErrorMessage="The password is required." Display="Dynamic" />
</div>

<div class="formLineItem">
    <asp:Label ID="lblPasswordConfirm" runat="server" Text="Password Confirmation"
        AssociatedControlID="txtPasswordConfirm" />
    <asp:TextBox TextMode="Password" ID="txtPasswordConfirm" runat="server" />
    <asp:RequiredFieldValidator ControlToValidate="txtPasswordConfirm" runat="server"
        ErrorMessage="The password confirmation is required." Display="Dynamic" />
    <asp:CustomValidator ControlToValidate="txtPasswordConfirm" runat="server"
        OnServerValidate="ValidatePassword" Text="Passwords do not match." Display="Dynamic" />
</div>

<asp:Button runat="server" Text="Save Changes" ID="btnSave" OnClick="btnSave_Click" />
<asp:HyperLink ID="hlBack" Text="Cancel" runat="server" NavigateUrl="~/admin/Administrators/" />
</asp:Content>